package com.rzy.k_cas.a;

import java.util.concurrent.CountDownLatch;

/**
 * @author gaopeng
 * @time 2021/05/20 17:41:54
 */


public class App {

    private static CountDownLatch cd = new CountDownLatch(10);
    static int count = 0;

    public static void main(String[] args) throws InterruptedException {

        for (int k = 1; k <= 10; k++) {
            new Thread(() -> {
                for (int i = 1; i <= 1000; i++) {
                    count++;
                }
                cd.countDown();
            }).start();
        }

        cd.await();
        System.out.println(count);

    }
}
